home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / editor / cedrexx.lha / cedrexx_scripts / UsenetStrip.ced < prev   
Text File  |  1996-05-07  |  2KB  |  81 lines

  1. /************************************************************\
  2. ** $VER: UsenetStrip 1.0                                    **
  3. ** By  : James Allen (AKA $LiNg$HoT)                        **
  4. ** Date: September 94                                       **
  5. ** Rel : May 96.                                            **
  6. ** Description :                                            **
  7. **                                                          **
  8. **     - Strips certain lines from a Usenet/E-Mail header.    **
  9. **     - Edit the names array and add/remove keywords.        **
  10. **   - If found somewhere on the line, the whole line goes. **
  11. **   - Press a key to abort at any time.                    **
  12. **   - IMPORTANT: Place a '##' at the end of the header!    **
  13. **                Otherwise the strip will not stop!        **
  14. **                                                          **
  15. \************************************************************/
  16.  
  17. address 'rexx_ced'
  18.  
  19. OPTIONS RESULTS
  20.  
  21. BEG OF FILE
  22.  
  23. CEDTOFRONT
  24.  
  25. call SetArray
  26.  
  27. Do until left(Line,2) = '##'
  28.     STATUS LINEBUFFER
  29.     Line = left(RESULT,13)
  30.     Delete = CheckField(Line)
  31.     If Delete = 1 | POS(':',Line) = 0 & left(Line,2) ~= '##' then 
  32.         'DELETE LINE'
  33.     Else
  34.         DOWN
  35.     LASTKEY
  36.     /* Check for a keystroke (~= -1) which is not an key release (< 128) */
  37.     IF (RESULT ~= -1) & (WORD( RESULT, 1 ) < 128) THEN DO
  38.         CEDTOFRONT
  39.         OKAY1 "UseNet Strip Aborted!"
  40.         EXIT
  41.     END
  42. End
  43.  
  44. CheckField:
  45. parse arg Line
  46.  
  47. do i=1 to names.0
  48.     If POS(names.i,Line) ~= 0 then Return 1
  49. End
  50. Return 0
  51.  
  52. SetArray:
  53. /* Any word in the array found in the header will result in the line
  54.    being deleted. Add or remove keywords to the following, incrementing/
  55.    decrementing as you do so. */
  56.  
  57.     names.0 = 19
  58.     names.1 = "Path"
  59.     names.2 = "To"
  60.     names.3 = "Received"
  61.     names.4 = "Message"
  62.     names.5 = "Error"
  63.     names.6 = "Reply"
  64.      names.7 = "Originator"
  65.     names.8 = "Sender"
  66.     names.9 = "Precedence"
  67.     names.10 = "X-List"
  68.     names.11 = "Organization"
  69.     names.12 = "Lines"
  70.     names.13 = "Status"
  71.     names.14 = "References"
  72.     names.15 = "Xref"
  73.     names.16 = "Distribution"
  74.     names.17 = "X-Newsreader"
  75.     names.18 = "Keywords"
  76.     names.19 = "Summary"
  77.     names.20 = "Mime-Version"
  78.     names.21 = Content-Type"
  79.  
  80. Return
  81.